package com.hypertech.core.ffmpeg.videoDao;


import java.util.ArrayList;
import java.util.List;

public class VideoOptions {

    private String cmd = "ffmpeg -i";

    private String src;

    private String dest;

    private List<String> options = new ArrayList<>();


    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    public String getDest() {
        return dest;
    }

    public void setDest(String dest) {
        this.dest = dest;
    }

    public List<String> getOptions() {
        return options;
    }

    public void setOptions(List<String> options) {
        this.options = options;
    }

    public void addOption(String option) {
        options.add(option);
    }


    /*初始化ffpmeg命令
    * 使用参数*/
    public String build() {
        StringBuilder builder = new StringBuilder(this.cmd);
        builder.append(" ").append(this.src);

        for (String option:options) {
            builder.append(" ").append(option);
        }

        builder.append(" ").append(this.dest);
        return builder.toString();
    }

}